import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysParam = (params) => {
  params.head.transCode = 'querySysParam';
  return request({
    url: '/platform/sysParam/querySysParam',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysParamListPage = (params) => {
  params.head.transCode = 'querySysParamListPage';
  return request({
    url: '/platform/sysParam/querySysParamListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysParam = (params) => {
  params.head.transCode = 'saveSysParam';
  return request({
    url: '/platform/sysParam/saveSysParam',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysParamList = (params) => {
  params.head.transCode = 'saveSysParamList';
  return request({
    url: '/platform/sysParam/saveSysParamList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysParam = (params) => {
  params.head.transCode = 'saveOrUpdateSysParam';
  return request({
    url: '/platform/sysParam/saveOrUpdateSysParam',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysParamList = (params) => {
  params.head.transCode = 'saveOrUpdateSysParamList';
  return request({
    url: '/platform/sysParam/saveOrUpdateSysParamList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysParam = (params) => {
  params.head.transCode = 'updateSysParam';
  return request({
    url: '/platform/sysParam/updateSysParam',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysParam = (params) => {
  params.head.transCode = 'deleteSysParam';
  return request({
    url: '/platform/sysParam/deleteSysParam',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysParamList = (params) => {
  params.head.transCode = 'deleteSysParamList';
  return request({
    url: '/platform/sysParam/deleteSysParamList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysParamExcel = (params) => {
  downloadExcel({
    url: '/platform/sysParam/excelDownload/exportSysParamExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
